import java.util.Scanner;

public class text4 {
    public static int fun4(int n){
        if(n<10)
            return n;
        return (n%10)+fun4(n/10);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(fun4(n));
        sc.close();
    }
}